/*
* MSelect
*/
.M-select{
  display: inline-block;
  position: relative;
  color: #666;
  font-size: 12px;
  cursor: pointer;
  outline: none;
  user-select: none;
  background-color: #fff;
  border-radius: 4px;
  border: 1px solid #d9d9d9;
  transition: all .3s cubic-bezier(.645,.045,.355,1);
  &:hover{
    border-color: #40a5ed;
  }
  .M-select-selection{
    display: block;
    z-index: 1;
    padding: 0 8px;
    position: relative;
    line-height: 26px;
    .M-select-selection-selected{
      float: left;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      max-width: 100%;
      padding-right: 14px;
    }
    &:after{
      content: '.';
      visibility: hidden;
      pointer-events: none;
      display: inline-block;
      width: 0;
    }
  }
  .M-select-allow{
    filter: none;
    font-style: normal;
    vertical-align: baseline;
    text-align: center;
    text-transform: none;
    text-rendering: auto;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: absolute;
    top: 50%;
    right: 8px;
    line-height: 1;
    margin-top: -5px;
    display: inline-block;
    font-size: 12px;
    font-size: 9px \9;
    transition: transform 0.2s ease;
    transform: scale(0.75) rotate(0deg);
    zoom: 1;
  }
  .M-select-dropdown{
    background-color: #fff;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    z-index: 1050;
    position: absolute;
    outline: none;
    overflow: hidden;
    font-size: 12px;
    left: 0;
    top: 100%;
    margin-top: 4px;
    width: 100%;
    opacity: 0;
    transition: all 0.4s ease;
    transform: scaleY(0);
    .M-select-dropdown-menu{
      outline: none;
      margin-bottom: 0;
      padding-left: 0;
      list-style: none;
      max-height: 250px;
      overflow: auto;
      .M-select-dropdown-menu-item{
        position: relative;
        display: block;
        padding: 7px 16px;
        font-weight: normal;
        color: #666;
        cursor: pointer;
        white-space: nowrap;
        overflow: hidden;
        transition: background 0.4s ease;
        &:hover{
          background: #e7f4fd;
        }
      }
      .M-select-dropdown-menu-item-selected{
        background-color: #f7f7f7;
        font-weight: bold;
        &:hover{
          background-color: #f7f7f7;
          font-weight: bold;
        }
      }
    }
  }
}
.M-select-lg{
  .M-select-selection{
    line-height: 30px;
  }
}
.M-select-sm{
  .M-select-selection{
    line-height: 20px;
  }
}
.M-select-open{
  border-color: #40a5ed;
  outline: 0;
  box-shadow: 0 0 0 2px rgba(16, 142, 233, 0.2);
  .M-select-allow{
    transform:scale(0.75) rotate(180deg);
  }
}

/*
* animate
*/

.M-select-open{
  .M-select-dropdown{
    animation: MSelectDropdown 0.3s;
    animation-fill-mode:forwards;
  }
}
.M-select-close{
  .M-select-dropdown{
    animation: MSelectDropUp 0.3s;
    animation-fill-mode:forwards;
  }
}
@keyframes MSelectDropdown{
  0% {
    opacity: 0;
    transform-origin: 0% 0%;
    transform: scaleY(0.8);
  }
  100%{
    opacity: 1;
    transform-origin: 0% 0%;
    transform: scaleY(1);
  }
}
@keyframes MSelectDropUp{
  0% {
    opacity: 1;
    transform-origin: 0% 0%;
    transform: scaleY(1);
  }
  100% {
    opacity: 0;
    transform-origin: 0% 0%;
    transform: scaleY(0.8);
  }
}